#!/usr/bin/python
# -*- coding: UTF-8 -*-

import threading
import time


class MyThread(threading.Thread):
    def __init__(self, name, delay):
        threading.Thread.__init__(self)
        self.name = name
        self.delay = delay

    def run(self):
        print(self.name)
        print_count(self.name, self.delay)


def print_count(name, delay):
    count = 5
    while count > 0:
        time.sleep(delay)
        print(name, count)
        count -= 1
    else:
        print(name, "Exit!!!")


MyThread("thread-1", 1).start()
MyThread("thread-2", 2).start()
